Skip to content

Add photo/video gallery from Parro messages#8

Merged
lukasvan3l merged 1 commit into
mainfrom
claude/parro-photo-downloads-d26wi0
Jul 10, 2026
Merged

Add photo/video gallery from Parro messages#8
lukasvan3l merged 1 commit into
mainfrom
claude/parro-photo-downloads-d26wi0

Conversation

@lukasvan3l

Copy link
Copy Markdown
Member

Adds a new "Foto's" (Photos) tab to the Parro dashboard that displays images and videos extracted from Parro messages in a gallery view with lightbox and download functionality.

Summary

This PR introduces end-to-end photo/video handling for the Parro dashboard:

  • Backend agent (fotos.mjs): Extracts attachments from Parro messages, locates cached files downloaded by the parro CLI, and uploads them to a private Supabase Storage bucket
  • Database: New parro_fotos table stores metadata (filename, content type, date) with foreign key to items; private parro-fotos storage bucket with RLS policy restricting access to family members
  • Frontend: New "Foto's" tab displays photos/videos grouped by date in a responsive grid, with a lightbox modal for viewing full-size and downloading

Key changes

  • agent/fotos.mjs (new): Processes attachments from raw Parro JSON, finds locally cached files in ~/.cache/parro/<guardian>/, uploads to storage, and inserts metadata rows
  • supabase/schema.sql: Adds parro_fotos table, private parro-fotos storage bucket, RLS policies, and indexes
  • index.html:
    • New "Foto's" tab with gallery grid layout and lightbox modal
    • CSS for photo grid, lightbox overlay, and video play button
    • Alpine.js methods to load photos with signed URLs, group by date, and handle downloads
    • Real-time subscription to parro_fotos table changes
  • agent/db.mjs: New helper functions (getItemsMetRaw, bestaandeFotoIds, uploadFoto, insertFoto) for the fotos agent
  • agent/run.sh: Integrated fotos.mjs into the sync pipeline (after sync.mjs, before enrich.mjs)
  • Documentation: Updated CLAUDE.md, agent/README.md, and supabase/README.md to describe the photo workflow

Implementation notes

  • Photos are stored in a private bucket (not publicly accessible); the frontend generates temporary signed URLs (1-hour expiry) that only work for authenticated family members
  • The agent uses the parro CLI's cache (~/.cache/parro/) to avoid needing OAuth tokens; it searches by message ID and filename or falls back to index-based matching
  • Storage paths are sanitized to remove special characters; content types are inferred from file extensions if Parro doesn't provide them
  • The gallery groups photos by date and displays video thumbnails with a play icon; clicking opens a lightbox with controls to download or close

https://claude.ai/code/session_0149Bcafp6Q3HgKXV2nQmqEF

Nieuwe Foto's-tab (galerij + lightbox + download). De bijlagen die
gwillem/parro al naar ~/.cache/parro/ downloadt worden door een nieuw
agent-script (fotos.mjs) naar een private Supabase-bucket geüpload; de
frontend toont ze via tijdelijke signed URLs, alleen voor gezinsleden.

- supabase/schema.sql: parro_fotos-tabel + RLS + private bucket 'parro-fotos'
- agent/fotos.mjs + db.mjs-helpers; ingehaakt in run.sh en package.json
- index.html: Foto's-tab, galerij per dag, lightbox met download
- docs bijgewerkt (CLAUDE.md, agent/README.md, supabase/README.md)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0149Bcafp6Q3HgKXV2nQmqEF
@lukasvan3l lukasvan3l merged commit 5aeb523 into main Jul 10, 2026
2 checks passed
@lukasvan3l lukasvan3l deleted the claude/parro-photo-downloads-d26wi0 branch July 10, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants